home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-06-15 | 7.2 KB | 194 lines | [TEXT/MPS ] |
- /*------------------------------------------------------------------------------
- *
- * Apple Macintosh Developer Technical Support
- *
- * Installer 3.4 sample: Action Atom sample to install a file in the
- * System Folder of the boot volume.
- *
- * File: InstallFileOnBootVol.r - Rez Source
- *
- * Modifications:
- * 5/19/93: RRK Changed Target file spec typeCrMustMatch flag setting to
- * typeCrNeedNotMatch and included comment that this will
- * allow the replacement of the target file if for some reason
- * the file or creator are different.
- * Used InstallerCommon.r defines.
- *
- * by: Rich Kubota
- *
- * Copyright © 1991 Apple Computer, Inc.
- * All rights reserved.
- *
- *------------------------------------------------------------------------------
- *
- * Install application "TheProgram" into the Start-up folder in the boot system
- * folder regardless of the volume selected by the user. There are a number of
- * caveats associated with using this sample action atom. See the code resource
- * for the specific caveats.
- *----------------------------------------------------------------------------*/
-
- #include "Types.r"
- #include "InstallerTypes.r"
- #include "InstallerCommon.r" /* list of macros to simplify list */
-
- /* 'inaa' code resource definition */
- #define aaCodeID 128
-
- /* You can build and complete the script with the following lines:
- # Note: set up floppies with the appropriate names and contents before running scriptcheck
- # or set up folders with the same names and contents as the floppies
- # put these folders in the same folder as the script or at the root directory of same disk
-
- rez -o "InstallFileOnBootVol" -t 'bbkr' -c 'bbkr' "InstallFileOnBootVol.r"
- setfile -a i "InstallFileOnBootVol" #mark Inited
- scriptcheck -p "InstallFileOnBootVol"
- */
-
- #define kMinMemMB 01 /* memory needed to install (UPDATE Error Message if changed!)*/
-
- /* Definitions for the rules */
- #define rlCheckMemSize 1000
- #define rlOutputMemSizeError 1001
-
- /* Defines for the file spec atoms (specifications for source and destination files) */
- #define fsSourceProgram 2000
- #define fsTargetProgram 2001
-
- /* This is the name of the source disk */
- #define ProgramDisk "Program Disk:"
-
- /* where we want to install our file on the boot volume - use folder mgr designation. */
- #define TargetPath "Special-strt:"
-
- /* Definition for the package. */
- #define pkTheProgram 3000
-
- /* Definition for the file atom */
- #define faProgram 4000
-
- /* Definition for the package comment resource */
- #define cmtTheProgram 5000
-
- /* Definitions for the action atom resources */
- #define aaInstallFile 6000
-
- /* May 19, 1993 is the current release date I put in 'icmt' rsrcs. ScriptCheck will convert */
- /* this value to a LongInt seconds value needed by the Installer. */
- #define currentReleaseDate 5191993
- #define currentVersion 102 /* Version 1.0.2 goes in the 'icmt' rsrc */
-
- #define iconTheProgram 5100
-
- /************************** Easy Install Rule resources **********************************/
- resource 'infr' (1) {
- format0 {{
- pickFirst, {rlCheckMemSize, rlOutputMemSizeError}, /* Select only one of these rules */
- }};
- };
-
- resource 'inrl' (rlCheckMemSize) {
- format0 {{
- /* If the system has at least kMinMemMB megs of memory, then add the package */
- checkMinMemory {kMinMemMB},
- addUserDescription {"The Program\n"}, /* message to appear in Easy Install screen */
- addPackages {{pkTheProgram}} /* we're installing the program */
- }};
- };
-
- resource 'inrl' (rlOutputMemSizeError) {
- format0 {{
- /* This error message will be displayed on the Easy Install screen if this rule */
- /* fires. It fires if the first rule in this pickFirst group does not fire */
-
- reportSysError {"To do installation you need:\n\n"},
- reportSysError {"• At least 1 megabyte of memory\n"} /*if kMinMemMB changes FIX HERE! */
- }};
- };
-
- /***************************** Package Resources ************************************************/
- resource 'inpk' (pkTheProgram) {
- format0 {
- showsOnCustom, /* Package appears in the Custom Install display */
- notRemovable, /* Package can be removed */
- dontForceRestart, /* no need to reboot after live install */
- cmtTheProgram, /* package's 'icmt' resource id */
- 0, /* Package size (filled in by ScriptCheck) */
- "Teach Text in Boot System Folder", {
- /* package name for package that shows on custom */
- 'inaa', aaInstallFile;
- }
- }
- };
-
- /***************************** Comments ************************************************/
- resource 'icmt' (cmtTheProgram) {
- currentReleaseDate,
- currentVersion,
- iconTheProgram,
- "This package installs TeachText into the startup folder in the boot system folder. "
- };
-
- resource 'ICON' (iconTheProgram) {
- $"0430 4000 0A50 A000 0B91 1002 0822 0803"
- $"1224 0405 2028 0209 4010 0111 800C 00A1"
- $"8003 FFC2 7E00 FF04 0100 7F04 0300 1E08"
- $"04E0 000C 08E0 000A 10E0 0009 08C0 0006"
- $"0487 FE04 0288 0104 0188 0084 0088 0044"
- $"0088 0044 0088 00C4 0110 0188 0228 0310"
- $"01C4 04E0 0002 0800 73BF FBEE 4CA2 8A2A"
- $"40AA AAEA 52AA AA24 5EA2 8AEA 73BE FB8E",
- };
-
-
- /********************************************* File Specs ******************************************/
- /* Source File Specs */
- resource 'infs' (fsSourceProgram) {
- 'APPL', /* File Type */
- 'ttxt', /* Creator */
- kScriptCheckSetsDate, /* ScriptCheck fills in the creation date */
- noSearchForFile, /* Do not search the source disk for the file */
- typeCrMustMatch, /* file type and creator on source disk must match */
- ProgramDisk"TeachText" /* Path to the file */
- };
-
- /* Target File Specs */
- resource 'infs' (fsTargetProgram) {
- 'APPL', /* File Type */
- 'ttxt', /* Creator */
- kNoDateStampCheck, /* creation date must be zero for target file spec */
- noSearchForFile, /* Do not search the target disk for the file */
- typeCrNeedNotMatch, /* file to be replaced even if F&C don't match */
- TargetPath"TeachText" /* destination Path */
- };
-
- /******************************************** File Atoms ************************************************/
- resource 'infa' (faProgram) {
- format0 {
- StdRemLeaveNewerCopy, /* see InstallerCommon.r */
- fsTargetProgram, /* TARGET file spec */
- fsSourceProgram, /* SOURCE file spec */
- 0, /* atom size (filled in by ScriptCheck) */
- "" /* Atom Description (for a file Installer will use file name) */
- };
- };
-
- /******************************************** Action Atoms ************************************************/
- resource 'inaa' (aaInstallFile) {
- format1 {
- continueBusyCursors, /* have the busy cursor continue to display while file being installed */
- actAfter, /* act after the rest of the installation has run */
- dontActOnRemove, /* the atom does not recognise the option to remove the file */
- actOnInstall, /* act when the user clicks the Install button */
- 'infn', /* resource type of code resource */
- aaCodeID, /* code resource ID to execute */
- faProgram, /* for this example, pass the 'infa' resource ID of the file to
- * copy to the System Folder of the boot disk.
- */
- "Installing TeachText in the startup folder on the boot drive."
- }
- };
-
-
- INCLUDE "InstallFileOnBootVol.rsrc" 'infn' (10000) AS 'infn' (aaCodeID, $$Attributes);
-
-